#define _CRT_SECURE_NO_WARNINGS 1


#include "Sort.h"


void TestInsertSort()
{
	//int a[] = { 1,2,3,6,7,9,4 };
	int a[] = { 3,2,6,9,1,3,7,5 };
	Print(a, sizeof(a) / sizeof(int));
	InsertSort(a,sizeof(a)/sizeof(int));
	Print(a, sizeof(a) / sizeof(int));
}

void TestShellSort()
{
	//int a[] = { 3,2,6,9,1,3,7,5 };
	int a[] = { 9,1,2,5,7,4,8,6,3,5 };
	Print(a, sizeof(a) / sizeof(int));
	ShellSort(a, sizeof(a) / sizeof(int));
	Print(a, sizeof(a) / sizeof(int));
}
void TestSelectSort()
{
	//int a[] = { 3,2,6,9,1,3,7,5 };
	int a[] = { 9,1,2,5,7,4,8,6,3,5 };
	Print(a, sizeof(a) / sizeof(int));
	SelectSort(a, sizeof(a) / sizeof(int));
	Print(a, sizeof(a) / sizeof(int));
}
void TestHeapSort()
{
	//int a[] = { 3,2,6,9,1,3,7,5 };
	int a[] = { 9,1,2,5,7,4,8,6,3,5 };
	Print(a, sizeof(a) / sizeof(int));
	HeapSort(a, sizeof(a) / sizeof(int));
	Print(a, sizeof(a) / sizeof(int));
}
void TestBubbleSort()
{
	//int a[] = { 3,2,6,9,1,3,7,5 };
	int a[] = { 9,1,2,5,7,4,8,6,3,5 };
	Print(a, sizeof(a) / sizeof(int));
	BubbleSort(a, sizeof(a) / sizeof(int));
	Print(a, sizeof(a) / sizeof(int));
}

void TestQuickSortNonR()
{
	//int a[] = { 3,2,6,9,1,3,7,5 };
	int a[] = { 9,1,2,5,7,4,8,6,3,5 };
	Print(a, sizeof(a) / sizeof(int));
	QuickSortNonR(a,0, sizeof(a) / sizeof(int)-1);
	Print(a, sizeof(a) / sizeof(int));
}
void TestQuickSort()
{
	//int a[] = { 3,2,6,9,1,3,7,5 };
	int a[] = { 9,1,2,5,7,4,8,6,3,5 };
	Print(a, sizeof(a) / sizeof(int));
	QuickSort(a, 0, sizeof(a) / sizeof(int) - 1);
	Print(a, sizeof(a) / sizeof(int));
}
void TestMergeSort()
{
	//int a[] = { 3,2,6,9,1,3,7,5 };
	int a[] = { 9,1,2,5,7,4,8,6,3,5 };
	Print(a, sizeof(a) / sizeof(int));
	MergeSort(a,sizeof(a) / sizeof(int));
	Print(a, sizeof(a) / sizeof(int));
}
void TestMergeSortNonR()
{
	//int a[] = { 3,2,6,9,1,3,7,5 };
	int a[] = { 9,1,2,5,7,4,8,6,3,5 };
	Print(a, sizeof(a) / sizeof(int));
	MergeSortNonR(a, sizeof(a) / sizeof(int));
	Print(a, sizeof(a) / sizeof(int));
}
void TestCountSort()
{
	//int a[] = { 3,2,6,9,1,3,7,5 };
	int a[] = { 9,1,2,5,7,4,8,6,3,5 };
	Print(a, sizeof(a) / sizeof(int));
	CountSort(a, sizeof(a) / sizeof(int));
	Print(a, sizeof(a) / sizeof(int));
}
int main()
{
	//TestInsertSort();
	//TestShellSort();
	//TestSelectSort();
	//TestHeapSort();
	//TestBubbleSort();
	//TestQuickSort();
	//TestQuickSortNonR();
	//TestMergeSort();
	//TestMergeSortNonR();
	TestCountSort();
	//TestOP();
	
	return 0;
}